package com.woniu.dao.backpage;

import com.woniu.entity.Goods;
import com.woniu.entity.GoodsImage;
import com.woniu.entity.Image;
import com.woniu.entity.RushPurchase;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author 陈乙嘉
 * @data ${DATE} ${TIME}
 */
@Repository
public interface GoodsDao {

    //根据条件查询商品
    List<Goods> findGoodsByConditions(@Param("name") String name,
                                      @Param("typeName") String typeName,
                                      @Param("putOn") Integer putOn,
                                      @Param("minPrice") Double miniPrice,
                                      @Param("maxPrice") Double maxPrice);
    //改变商品上下架状态
    void deleteGoods(@Param("id") Integer id,
                     @Param("putOn") Integer putOn);

    //新增商品
    void insertGoods(Goods goods);

    //改变商品抢购状态
    void updateRushPurchaseStatus(RushPurchase rushPurchase);

    //商品详情;修改商品
    void updateGoods(Goods goods);

    Goods findGoodsByName(@Param("name") String name);

    void insertRushPurchase(RushPurchase rushPurchase);

    //修改商品库存
    void updateCount(Integer count,Integer id);

    void insertImage(Image image);

    void insertGoodsImage(GoodsImage goodsImage);

    Image findImageByImgUrl(Image image);

    void batchInsertGoodsImage(@Param("goodsId")Integer goodsId,
                               @Param("tagIds") List<Integer> tagIds);

}
